Add config source interface and environment variable source#5
Open
ubaskota wants to merge 4 commits intoconfig_resolutionfrom
Open
Add config source interface and environment variable source#5ubaskota wants to merge 4 commits intoconfig_resolutionfrom
ubaskota wants to merge 4 commits intoconfig_resolutionfrom
Conversation
SamRemis
reviewed
Feb 17, 2026
Comment on lines
+9
to
+15
| def test_implements_config_source_protocol(self): | ||
| source = EnvironmentSource() | ||
| assert isinstance(source, ConfigSource) | ||
| assert hasattr(source, "name") | ||
| assert hasattr(source, "get") | ||
| assert callable(source.get) | ||
|
|
There was a problem hiding this comment.
This test seems like overkill. It should be safe due to typechecking from the resolver, right?
Owner
Author
There was a problem hiding this comment.
Yes, its type checked when called from the resolver.
| assert value1 != value2 | ||
|
|
||
| def test_env_var_names_are_case_sensative(self): | ||
| with patch.dict(os.environ, {"aws_region": "us-west-2"}, clear=False): |
There was a problem hiding this comment.
This may not work on systems where the host has case-insensitive environment variables like windows.
Owner
Author
There was a problem hiding this comment.
Noted. I decided to remove this test as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
This change adds the
ConfigSourceprotocol to smithy-coreinterfaces and implementsEnvironmentSourceinsmithy-aws-corefor resolving configuration values from environment variables. Includes unit tests covering protocol compliance, key-to-env-var mapping, edge cases, and no-caching behavior.Added unit tests to validate the expected behavior. Verified that tests pass.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.